#include <stdio.h>

#define MAX_SIZE 50000

int main(int argc, char *argv[])
{
	int n, i, j, a, b, mark[MAX_SIZE], max;

	scanf("%d", &n);

	for (i=0; i<MAX_SIZE; i++) {
		mark[i] = 0;
	}

	for (i=0; i<n; i++) {
		scanf("%d %d", &a, &b);
		for (j=a; j<b; j++) {
			mark[j] += 1;
		}
	}

	max = 0;
	for (i=0; i<MAX_SIZE; i++) {
		if (mark[i] > max) max = mark[i];
	}

	printf("%d\n", max);

	return 0;
}
